package com.snc.controller.app;


import com.snc.annotation.SystemLog;
import com.snc.plugin.Result;
import com.snc.util.DynamicCodeUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * APP-用户注册，登陆，找回密码等。
 */
@Controller
@RequestMapping("/app/")
public class CommonController {

    @ResponseBody
    @RequestMapping(method = RequestMethod.POST, value = "sendSMSCode")
    @SystemLog(module = "APP-短信验证码发送", methods = "短信验证码发送")
    public Result sendSMSCode(HttpServletRequest request, String phone) {

        DynamicCodeUtils.sendSMSCode(phone);

        return Result.Success("短信发送成功，请注意查收");
    }

    /**
     * 获取实时数据，目前主要是获取待评价的数量
     *
     * @param userId
     * @return
     */
    @ResponseBody
    @RequestMapping("realData")
    public Result realData(Long userId) {

        return Result.Success(0);
    }

}